<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <ul class="nav nav-tabs" >
        <li class="active">
            <a href="#tab-general" data-toggle="tab" aria-expanded="false">基本信息</a>
        </li>
        <li class="">
            <a href="#tab-content" data-toggle="tab" aria-expanded="false">详情描述</a>
        </li>
        <li class="">
            <a href="#tab-images" data-toggle="tab" aria-expanded="false">图片信息</a>
        </li>
        <li class="">
            <a href="#tab-orther" data-toggle="tab" aria-expanded="false">其他信息</a>
        </li>
    </ul>
    <div class="tab-content" style="padding-top: 10px;">
        <div class="tab-pane active" id="tab-general">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
                </div>
            </div>
            <!--<div class="form-group">-->
            <!--    <label class="control-label col-xs-12 col-sm-2">{:__('Village_id')}:</label>-->
            <!--    <div class="col-xs-12 col-sm-8">-->
            <!--        <input id="c-village_id" data-rule="required" data-source="xiluhouse/rent/village/index" class="form-control selectpage" name="row[village_id]" type="text" value="">-->
            <!--    </div>-->
            <!--</div>-->
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('小区')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-village" data-rule="required" class="form-control" name="row[village]" type="text" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-user_id" data-source="xiluhouse/user/user/index" data-field="nickname" data-params='{"custom[userprofile.is_broker]":["in","1,2"]}' class="form-control selectpage" name="row[user_id]" type="text" value="0">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Is_public')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="isPublicList" item="vo"}
                        <label for="row[is_public]-{$key}"><input id="row[is_public]-{$key}" name="row[is_public]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
                <div class="col-xs-12 col-sm-8">
                    
                    <div class="radio">
                    {foreach name="stateList" item="vo"}
                    <label for="row[state]-{$key}"><input id="row[state]-{$key}" name="row[state]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                    </div>
        
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('House_type_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-house_type_id" data-rule="required" data-source="xiluhouse/house/housetype/index" data-params='{"custom[status]":"normal"}' class="form-control selectpage" name="row[house_type_id]" type="text" value="">
                </div>
            </div>
            {volist name="tag_type" id="vo"}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{$vo.name}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-house_tag_ids{$key}" data-rule="" data-source="xiluhouse/house/housetag/index" data-multiple="{$vo.multi_status == 1?'false':'true'}" class="form-control selectpage" name="row[tag][{$vo.id}]" type="text" value="">
                </div>
            </div>
            {/volist}
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Space')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-space" class="form-control" name="row[space]" type="number" value="0">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Room_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-room_num" class="form-control" name="row[room_num]" type="number" value="1">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('步梯/电梯')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">

                    <label for="row[ladder]-1">
                        <input id="row[ladder]-1" name="row[ladder]" type="radio" value="1"/>步梯
                    </label>
                    <label for="row[ladder]-2">
                        <input id="row[ladder]-2" name="row[ladder]" type="radio" value="2" checked />电梯
                    </label>

                    </div>

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Ting_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-ting_num" class="form-control" name="row[ting_num]" type="number" value="0">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Wei_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-wei_num" class="form-control" name="row[wei_num]" type="number" value="0">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Face')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-face" class="form-control" name="row[face]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Floor_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-floor_num" class="form-control" name="row[floor_num]" type="number" value="1">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('房号')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-room_number" class="form-control" name="row[room_number]" type="text" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                <div class="col-xs-12 col-sm-8">
                    
                    <div class="radio">
                    {foreach name="statusList" item="vo"}
                    <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                    </div>
        
                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-content">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-images">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-image" class="form-control" size="50" name="row[image]" type="text">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-image"></span>
                    </div>
                    <ul class="row list-inline plupload-preview" id="p-image"></ul>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-images" class="form-control" size="50" name="row[images]" type="textarea">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-images"></span>
                    </div>
                    <ul class="row list-inline plupload-preview" id="p-images"></ul>
                </div>
            </div>
        </div>
        <div class="tab-pane" id="tab-orther">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Building_descript')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[building_descript]" data-template="building_descripttpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>值</ins>
                        </dd>
                        <dd>
                        <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                        </dd>
                        <textarea name="row[building_descript]" class="form-control hide" cols="50" rows="5"></textarea>
                    </dl>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Cosult_tel')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-cosult_tel" class="form-control" name="row[cosult_tel]" type="text">
                </div>
            </div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form> 
<!--定义模板-->
<script type="text/html" id="testtpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="10">
        
        <div class="input-group">
            <input id="c-images<%=index%>" type="textarea" name="row[<%=name%>][<%=index%>][images]" class="form-control" value="<%=row['images']%>">
            <div class="input-group-addon no-border no-padding">
                <span><button type="button" id="plupload-images<%=index%>" class="btn btn-danger plupload" data-input-id="c-images<%=index%>" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images<%=index%>"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <span><button type="button" id="fachoose-images<%=index%>" class="btn btn-primary fachoose" data-input-id="c-images<%=index%>" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
            </div>
            <span class="msg-box n-right" for="c-images<%=index%>"></span>
        </div>
        <ul style="margin-bottom: 10px;" class="row list-inline plupload-preview" id="p-images<%=index%>"></ul>
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>
<script type="text/html" id="building_descripttpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="10">
        <input type="text" name="row[<%=name%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>
<script type="text/html" id="property_descripttpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="10">
        <input type="text" name="row[<%=name%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>

